bar=function(divId,data,opt){
	var type=opt.type||"v",
	shape=opt.shape||"square",
	dataArray=eval(data);
	xTotal=document.getElementById(divId).offsetWidth;
	yTotal=document.getElementById(divId).offsetHeight;
	xPos=xTotal*.10,
	yPos=yTotal*.10,
	xGraphLen=xTotal*.70,
	yGraphLen=yTotal*.70,
	xLegendLen=xTotal*.20,
	yLegendLen=yTotal*.20;
	
	var opts={
			type: shape || "square",
			strech: false

	};
	
	//Raphael Variable - START
	var r = Raphael(divId),
    fin = function () {
        this.flag = r.popup(
                this.bar.x, this.bar.y, this.bar.value || "0").insertBefore(this);
    },
    fout = function () {
        this.flag.animate({opacity: 0}, 300, function () {this.remove();});
    },
    txtattr = { font: "12px 'Fontin Sans', Fontin-Sans, sans-serif" };
    
    //adding text to Raphael div holder
    //r.text(160, 250, "Multiple Series Chart").attr(txtattr);
    
	//Raphael Variable - END	
	
    //initialize chart variable
    var chart;
    
	if(type=='h'){
		chart=r.hbarchart(xPos, yPos, xGraphLen, yGraphLen, dataArray,opts);
	}
	else{
        chart=r.barchart(xPos, yPos, xGraphLen, yGraphLen, dataArray,opts);
	}
	
	//chart settings after chart generation
	chart.hover(fin, fout);
	
};